#ifndef _SSBTC_DEFINE_H
#define _SSBTC_DEFINE_H


#include <vector>
#include <list>
#include <set>
#include "ICTCLAS30.h"

struct	Cluster
{
	int			Center;
	std::set<int>		SubElements;

};
typedef  std::vector<Cluster>		Clusters;
typedef  std::vector<Cluster>::iterator 	ClustersIt;


struct TWORD
{
	int			times;
};



struct my_result
{
protected:
	int			m_Ncount;
	int			m_countKey;
	result_t*			mp_result;
public:

	my_result(int count)
	{
		this->m_Ncount = count;

		mp_result = (result_t*)malloc(sizeof(result_t)*count);
	}
	~my_result()
	{
		/*if (mp_result != NULL)
		{
			free(mp_result);	
		}*/
	}
	my_result& operator=(const my_result& s)   
	{
		if (mp_result != NULL)
		{
			free(mp_result);	
			mp_result = NULL;
		}

		this->m_Ncount = s.m_Ncount;
		this->m_countKey = s.m_countKey;
		mp_result = (result_t*)malloc(sizeof(result_t)* s.m_Ncount);
		memcpy(mp_result, s.mp_result, sizeof(result_t)* s.m_countKey);
		return *this;
	}
	void copy(result_t* resultKey, int countKey)
	{
		if ( countKey > this->m_Ncount)
			return;
		m_countKey = countKey;
		memcpy(mp_result, resultKey, sizeof(result_t)* countKey);
	}
	

	const result_t* getResult()
	{
		return mp_result;
	}	
	const int getCount()
	{
		return m_countKey;
	}

};




#endif